<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="display" uri="/WEB-INF/tags/displaytag-12.tld"%>
<%@page import="com.opensymphony.module.sitemesh.Page"%>
<html>
<head>
<meta name="tab" content="students" />
<meta name="leftbar-link" content="add-to-batch"/>
<meta name="decorator" content="DefaultLayout"/>
</head>
<body>
<script type="text/javascript">

  function doSubmit(){

		document.getElementById('studentForm').action="chooseBatchForSelectedStudent.action";
		document.getElementById('studentForm').submit();
  }

</script>
<span id="pageHeading">Student Search For Batch<hr/></span>

<s:form name="studentForm" id="studentForm" action="/addToBatch.action" method="post">
<s:actionerror />
<table>
<tr>
	<td>First Name</td>
	<td><s:textfield label="First Name*" id="firstName" required="true" name="firstName" value="%{firstName}"/></td>
	<td>Last Name</td>
	<td><s:textfield label="Last Name*" id="lastName" required="true" name="lastName" value="%{lastName}"/></td>
</tr>

<tr>
	<td colspan="4" align="center"><s:submit theme="simple" id="submitBtn" value="Search" cssClass="orange"/>
</td>
</tr>

</table>

  <display:table name="studentList" id="student" class="dataTable" requestURI="/addToBatch.action"
      cellspacing="0"  sort="list"  pagesize="20" export="true" 
      decorator="org.displaytag.decorator.TotalTableDecorator" >
      <display:column title="Student Id" class="#externalLinks" media="html">
        <a href="<%=request.getContextPath()%>/viewStudent.action?studentId=${student.id}">
         ${student.id}
        </a> 
      </display:column>
      <display:column title="First Name" property="firstName" sortable="true"/>
      <display:column title="Last Name" property="lastName" sortable="true"/>
      <display:column title="Fathers Name" property="fathersName" sortable="true"/>
      <display:column title="Phone Name" property="contactNum1" sortable="true"/>
      <display:column>
		<input type="checkbox" id="studentIds" name="studentIds" value='${student.id}'/>
      </display:column>
</display:table>

<table border="0" width="100%">
 <tr>
    <td align="center">
	  <A class="orange" style="cursor:pointer;" onclick="javascript:doSubmit();">
	     Add To Batch
      </A>
    </td>
 </tr>
</table>

</s:form>
</body>
</html>
